﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category0
{
  public class MT076 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagSubItemDefinition U0004;
    private static SwiftTagSubItemDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagSubItemDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;

    [Description("Error Service Message Cryptographic Service Message.")]
    public Tag603 CSMOfClassESM_603
    {
      get
      {
        return new Tag603((SwiftElement) this, 0, (SwiftDefinitionElement) MT076.U0002);
      }
    }

    [Description("Error Service Message Cryptographic Service Message.")]
    public Tag603 Tag603_CSMOfClassESM
    {
      get
      {
        return this.CSMOfClassESM_603;
      }
    }

    public MT076()
      : base(true)
    {
    }

    public MT076(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT076.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT076.MessageDefinition = new SwiftMessageDefinition("MT076", "Error returned in MT 076 Certification Error");
      MT076.U0002 = new SwiftTagDefinition("CSMOfClassESM_603", "Error Service Message Cryptographic Service Message.");
      MT076.U0002.TagName = "{603:";
      MT076.U0003 = new SwiftTagSubItemDefinition("CSMOfClassESM1", "CSM Message identifier and class");
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0003);
      MT076.U0004 = new SwiftTagSubItemDefinition("CSMOfClassESM2", "Receiver specification");
      MT076.U0005 = new SwiftTagSubItemDefinition("Response", "Response");
      MT076.U0004.Elements.Add((SwiftDefinitionElement) MT076.U0005);
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0004);
      MT076.U0006 = new SwiftTagSubItemDefinition("CSMOfClassESM3", "Originator specification");
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0006);
      MT076.U0007 = new SwiftTagSubItemDefinition("CSMOfClassESM4", "CV expiry date");
      MT076.U0008 = new SwiftTagSubItemDefinition("Response", "Response");
      MT076.U0007.Elements.Add((SwiftDefinitionElement) MT076.U0008);
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0007);
      MT076.U000E = new SwiftTagSubItemDefinition("CSMOfClassESM5", "New highest PKS version");
      MT076.U000E.Mandatory = false;
      MT076.U000F = new SwiftTagSubItemDefinition("Response", "Response");
      MT076.U000E.Elements.Add((SwiftDefinitionElement) MT076.U000F);
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U000E);
      MT076.U0010 = new SwiftTagSubItemDefinition("CSMOfClassESM6", "SCR number");
      MT076.U0011 = new SwiftTagSubItemDefinition("Response", "Response");
      MT076.U0010.Elements.Add((SwiftDefinitionElement) MT076.U0011);
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0010);
      MT076.U0012 = new SwiftTagSubItemDefinition("CSMOfClassESM7", "Error Field");
      MT076.U0013 = new SwiftTagSubItemDefinition("Response", "Response");
      MT076.U0012.Elements.Add((SwiftDefinitionElement) MT076.U0013);
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0012);
      MT076.U0014 = new SwiftTagSubItemDefinition("CSMOfClassESM8", "PNL Field (and closing delimiter)");
      MT076.U0015 = new SwiftTagSubItemDefinition("Response", "Response");
      MT076.U0014.Elements.Add((SwiftDefinitionElement) MT076.U0015);
      MT076.U0002.Elements.Add((SwiftDefinitionElement) MT076.U0014);
      MT076.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT076.U0002);
    }
  }
}
